#pragma once

#include "../Common/client_base.h"
#include "irc_filter_manager.h"
#include "irc_nick_filter.h"

#include <deque>
#include <boost/asio.hpp>

using boost::asio::ip::tcp;
#include <boost/array.hpp>
#include <boost/function.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>

class Irc_Client
{
	public:
		Irc_Client( boost::asio::io_service &io, std::string ip, std::string port, std::string chan, std::string pass );
		~Irc_Client(void);

		void loop();

	private:
		tcp::socket socket;
		void event_nick( std::string );

		boost::array<char, 512> buffer;

		irc_filter_manager *manager;
		
		std::deque<std::string *> message_queue;

		std::string channel;
		std::string password;

		boost::interprocess::interprocess_recursive_mutex thread;
};

